package itcz.example.pattern.behavior_type.state.deom1;

/**
 * TODO 与 LiftState 相互聚合彼此，不太好，参考AI示例
 * @ClassName: Context
 * @Author: ITCZ
 * @Date: 2025-07-26
 * @Description: 状态模式 - 环境角色类
 */
public class Context {

    public static final  OpenState openState = new OpenState();
    public static final  CloseState closeState = new CloseState();
    public static final  RunState runState = new RunState();
    public static final  StopState stopState = new StopState();

    private LiftState liftState;

    public  LiftState getLiftState() {
        return liftState;
    }

    public void setLiftState(LiftState liftState) {
        this.liftState = liftState;
        this.liftState.setContext(this);
    }

    public void open() {
        this.liftState.open();
    }

    public void close() {
        this.liftState.close();
    }

    public void run() {
        this.liftState.run();
    }

    public void stop() {
        this.liftState.stop();
    }
}
